//package com.competition.web.admin.controller;
//
//import java.util.List;
//
//import javax.servlet.http.HttpServletRequest;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.param.impl.AssocIdParam;
//import com.param.impl.PageParam;
//import com.admin.vo.RegionVO;
//import com.response.vo.ResponseModel;
//import com.controller.base.AbstractCommonController;
//import com.basic.service.contract.IBaseService;
//import com.competition.param.impl.RegionAddParam;
//import com.competition.param.impl.RegionUpdateParam;
//import com.competition.web.admin.service.IRegionService;
//import com.competition.web.entity.Region;
//
//@RestController
//@RequestMapping("region")
//public class RegionController extends AbstractCommonController<Region, PageParam> {
//	private IRegionService service;
//
//	public RegionController(IRegionService service) {
//		this.service = service;
//	}
//
//	@RequestMapping(value = "/regionsByParentId", method = RequestMethod.POST)
//	public ResponseModel<List<Region>> regionsByParentId(@RequestBody @Validated AssocIdParam param) {
//
//		return ResponseModel.success(this.service.getRegionList(param.getId()));
//	}
//	
//	
//	@RequestMapping(value = "/regionsByProvinceId", method = RequestMethod.POST)
//	public ResponseModel<List<Region>> regionsByProvinceId(@RequestBody @Validated AssocIdParam param) {
//
//		return ResponseModel.success(this.service.getRegionList(param.getId()));
//	}
//	
//	/**
//	 * 添加
//	 * 
//	 * @param <V>
//	 * @param param
//	 * @return
//	 */
//	@PostMapping("/add")
//	public ResponseModel<Integer> insert(@RequestBody @Validated RegionAddParam param,
//			HttpServletRequest httpServletRequest) {
//		int id = this.service.parseInsert(param, Region.class);
//
//		return ResponseModel.<Integer>success(id);
//	}
//
//	@Override
//	protected IBaseService<Region> getBaseService() {
//		return this.service;
//	}
//
//	/**
//	 * 添加
//	 * 
//	 * @param <V>
//	 * @param param
//	 * @return
//	 */
//	@PostMapping("/update")
//	public ResponseModel<Integer> update(@Validated @RequestBody RegionUpdateParam param,
//			HttpServletRequest httpServletRequest) {
//		int res = this.service.parseUpdate(param, Region.class);
//		return ResponseModel.<Integer>success(res);
//	}
//
//	protected <VO> Class<VO> getTarget() {
//		return (Class<VO>) RegionVO.class;
//	}
//}